package com.zhkeshe.keshe.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhkeshe.keshe.entity.Device;
import com.zhkeshe.keshe.entity.UserDevice;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserDeviceMapper extends BaseMapper<UserDevice> {
    @Select("select *from [UserDevice] where UserId=#{UserId}")
    public List<UserDevice> selectByUserId(Long UserId);

    @Select("select *from [UserDevice] where DeviceId=#{DeviceId}")
    public UserDevice selectByDeviceId(Long DeviceId);
    @Insert("INSERT INTO [UserDevice] ( UserId, DeviceId) VALUES ( #{UserId}, #{DeviceId})")
    public void insertUserDevice(UserDevice userDevice);
}
